package com.masterrabbit.gmh.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class RabbitMQConfig {
    @Bean("aid001")
    public Queue aid001() {
        return QueueBuilder.durable("firstaid001").build();
    }

    //创建交换机 群发交换机
@Bean("myexchange")
public Exchange myexchange() {
    return ExchangeBuilder.fanoutExchange("aidexchange").build();
}

    @Bean
    public Binding binding(Queue aid001, Exchange aidexchange) {
        return BindingBuilder.bind(aid001).to(aidexchange).with("").noargs();
    }



}
